package com.xyebank.ledger.service.zl.dataprovider.sjd;


import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.xyebank.ledger.service.common.DataProvider;
import com.xyebank.ledger.vo.deal.ZLSJDApplicationInfVo;

@Component
public class ZLSjdApplyDataProvider implements DataProvider<ZLSJDApplicationInfVo> {

    @Autowired
    private ZLApplyRecordMapper mZlApplyRecordMapper;

    @Override
    public List<ZLSJDApplicationInfVo> get(Integer fromIdx, Integer tarNum) {
        List<ZLSJDApplicationInfVo> result = mZlApplyRecordMapper.selectByPaging(fromIdx, fromIdx + tarNum);
        return result;
    }


    @Override
    public List<ZLSJDApplicationInfVo> get(Date dateStart, Date dateEnd, Integer fromIdx, Integer tarNum) {
        List<ZLSJDApplicationInfVo> result = mZlApplyRecordMapper.selectByPeriod(dateStart, dateEnd, fromIdx, fromIdx + tarNum);
        return result;
    }


    @Override
    public Integer count(Date timeStart, Date timeEnd) {
        Integer count = mZlApplyRecordMapper.selectPeriodCount(timeStart, timeEnd);
        return count;
    }

}
